﻿using HCore;
using UnityEngine;

public class SpringDisplay : DisplayObject
{
    private GameObject _gameObject;

    public SpringDisplay(BaseGameEntity entity) : base(entity)
    {
        GameObject prefab = Resources.Load<GameObject>("pendulum");
        _gameObject = GameObject.Instantiate(prefab);
        _gameObject.name = "spring-" + entity.ID;
    }

    public override void Dispose()
    {
        // GameObject.Destroy(_gameObject);
        // _gameObject = null;
    }

    public override void Update()
    {
        _gameObject.transform.position = _owner.position.ToUVec3();
    }
}